package org.yjw.demo.service.user.impl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.yjw.demo.dao.user.UserMapper;
import org.yjw.demo.bean.entity.user.User;
import org.yjw.demo.service.user.UserService;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User findByid(Long id) {
        User byid = userMapper.findByid(id);
        return byid;
    }

    @Override
    public User findByName(String name) {
        User byName = userMapper.findByName(name);
        return byName;
    }

    @Override
    public Long insert(User user) {
        Long insert = userMapper.insert(user);
        return insert;
    }

}
